FROM node:16 as build
WORKDIR /opt
COPY . /opt
RUN npm config set registry https://registry.npmmirror.com
RUN npm install
RUN npm run build

FROM nginx:latest
WORKDIR /opt
RUN mkdir k8s_web
COPY --from=build /opt/dist /opt/k8s_web/dist
COPY ./nginx.conf /etc/nginx/nginx.conf
